#include <string.h>
#include <omnetpp.h>
#include "ai_sim.h"
#include "messages/controlInfo.h"
#include "awgr.h"

namespace ai_sim {
// The module class needs to be registered with OMNeT++
Define_Module(AWGR);

void AWGR::handleMessage(omnetpp::cMessage *msg)
{
    controlInfo* ctrlinfo = dynamic_cast<controlInfo*> (msg->getControlInfo());
    int destAddr = ctrlinfo->wavelength;
    EV << "destAddr" << destAddr << endl;
    send(msg, "awgr_port$o", destAddr); // send out the message
}
}
